import { HttpClient } from "../../../service/Http/HttpClient";
//设备导入模板下载
export const downDeviceTemplateUrl = "/api/files/device/downDeviceTemplate";
//设备档案导入
export const importDeviceUrl = "/api/files/device/upload/importDeviceExcel";
// const baseURl='http://192.168.251.182:8082'
export const facilityList = (data: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/device/findDevicePage", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
//获取终端设备列表
export const terminalmanagementList = (data: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/terminal/findTerminalPage", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
//获取终端列表(带上下线状态)
export const terminalStatusList = (data: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/terminal/findTerminalStatusList", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};

//获取终端协议下拉接口
export const agreementList = () => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/terminal/findProtocolTypeList", {
    method: "POST",
    headers: {},
  });
};
//终端设备新增
export const terminaladd = (data) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/terminal/save", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
//终端设备删除
export const terminaldelete = (data) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/terminal/delete", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
//设备管理分页查找

export const getDeviceManagement = (data: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/device/findDevicePage", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
//获取分项类型下拉

export const getComponentType = () => {
  const http = HttpClient.instance();
  return http.fetch("/api/ems/basecfg/device/getBaseDeviceType", {
    method: "POST",
    headers: {},
  });
};
//设备新增
export const Deviceadd = (data) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/device/save", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
//设备删除
export const Devicedelete = (data) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/device/delete", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
//批量设备绑定
export const Devicebinding = (data) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/device/addTerDeviceProtocolBatch", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
//批量设备解绑
export const Deviceunbind = (data) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/device/removeTerDeviceProtocolBatch", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};

//获取单个绑定列表
export const getbounddeal = (data) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/device/findProtocolParamsById", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
//根据终端ID和设备ID查询通讯参数
export const getfindProtocolParams = (data) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/device/findProtocolParams", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
//获取上下线记录

export const getupdown = (data: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/terminaldebug/getStatusLogById", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
//终端对时
export const getterminaltime = (data: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/terminaldebug/setTerminalTime", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
//时钟读秒
export const gettimeseconds = (data: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/terminaldebug/getTerminalTime", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
//结果查询列表

export const getresultsquery = (data: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/resultsqry/getCollectTaskList", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
//获取命令下拉

export const getorderselect = (data: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/platform/dict/getBaseDictDataByCode", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
//获取任务详情

export const getassignment = (data: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/resultsqry/getTaskResultByTaskId", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
//装载操作

export const getembarkation = (data: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/devicedebug/loadFiles", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
//读取操作

export const getdeviceread = (data: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/devicedebug/readFiles", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
//卸载操作

export const getunloaddevice = (data: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/devicedebug/deleteFiles", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
//抄读当前表码

export const getmeterreading = (data: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/devicedebug/readCurData", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
//抄读日冻结

export const getDaysfreezing = (data: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/devicedebug/readFrozenData", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
//updateDeviceParam
export const updateDeviceParam = (data: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/device/updateDeviceParam", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
export const remoteControl = (data: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/devicedebug/remoteControl", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
/**虚拟设备 开始 */
//查询虚拟设备绑定的设备列表
export const getDevicesByFictitiousId = (data: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/device/getDevicesByFictitiousId", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
///files/device/rebindBatch
//批量绑定设备
export const rebindBatch = (data: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/device/rebindBatch", {
    method: "POST",
    headers: {},
    body: JSON.stringify(data),
  });
};
/**虚拟设备 结束 */
